package com.domcer.ultra.menu.domain;

import lombok.*;
import org.bukkit.configuration.ConfigurationSection;

/**
 * @Author hang.wang
 * @Date 2025/1/31 09:59
 */
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MenuSettingsOpenItemDomain {
    private String material;
    private boolean leftClick;
    private boolean rightClick;

    public static MenuSettingsOpenItemDomain assemble(ConfigurationSection section) {
        if (section == null) {
            return null;
        }

        return MenuSettingsOpenItemDomain.builder()
                .material(section.getString("material"))
                .leftClick(section.getBoolean("left-click", false))
                .rightClick(section.getBoolean("right-click", false))
                .build();
    }
}
